from django.db import models


# Create your models here.
class Areas(models.Model):
    """
    行政区划
    """
    name = models.CharField(max_length=20, verbose_name=u"名称")
    parent = models.ForeignKey('self', on_delete=models.SET_NULL, related_name="subs", null=True, blank=True,
                               verbose_name=u"上级行政区")

    class Meta:
        db_table = "tb_areas"
        verbose_name = u"行政区划"
        verbose_name_plural = u"行政区划"

    def __str__(self):
        return self.name
